package cn.pzhuWEB.llk.service.impl;

import cn.pzhuWEB.llk.dao.PuzzleInfoDao;
import cn.pzhuWEB.llk.entity.ImagePath;
import cn.pzhuWEB.llk.entity.PuzzleRecord;
import cn.pzhuWEB.llk.entity.User;
import cn.pzhuWEB.llk.service.PuzzleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class PuzzleInfoServiceImpl implements PuzzleInfoService {
    @Autowired
    PuzzleInfoDao puzzleInfoDao;

    @Override
    public String queryCompTime(PuzzleRecord puzzleRecord) {
        return puzzleInfoDao.queryCompTime(puzzleRecord);
    }

    @Override
    public void insertPuzzleGrade(PuzzleRecord puzzleRecord) {
        puzzleInfoDao.insertPuzzleGrade(puzzleRecord);
    }

    @Override
    public void updatePuzzleRank(PuzzleRecord puzzleRecord) {
        puzzleInfoDao.updatePuzzleRank(puzzleRecord);
    }

    @Override
    public void insertPuzzleRank(PuzzleRecord puzzleRecord) {
        puzzleInfoDao.insertPuzzleRank(puzzleRecord);
    }

    @Override
    public Integer findGradeByTimeRank(PuzzleRecord puzzleRecord) {
        return puzzleInfoDao.findGradeByTimeRank(puzzleRecord);
    }

    /**
     * 查询用户拼图游戏排行
     * @param partten
     * @param level
     * @return
     */
    @Override
    public List<User> findGradeByPatternAndLevel(String partten, int level) {
        return puzzleInfoDao.findGradeByPatternAndLevel(partten,level);
    }

    /**
     * 查询所有照片
     * @return
     */
    @Override
    public ArrayList<ImagePath> findAllPhoto() {
        return puzzleInfoDao.findAllPhoto();
    }

}
